<template>
  <div id="app">
    <img alt="Vue logo" src="./assets/logo.png">
    <HelloWorld ref="helloWorld" msg="Welcome to Your Vue.js App" v-if="isShow"/>
  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue'

export default {
  name: 'App',
  components: {
    HelloWorld
  },
  data() {
    return {
      isShow:false
    }
  },
  created() {
    
  },
  mounted() {
    this.hello()
  },
  methods: {
    hello() {
      // return new Promise((resolve) => {
        this.isShow = true
      //   resolve()
      // }).then(() => {
          this.$nextTick(() => {
            this.$refs.helloWorld.create()
          })
      // }).catch(() => {
      //   new Error()
      // })
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
